﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace QLTV.HeThongXuLy
{
    class NguoidungDB
    {
        public static bool KiemTraNguoiDung(Nguoidung user)
        {
            string sql = "select * from DANGNHAP where MaDangNhap = '" + user.TenNguoiDung + "' and MatKhau = '" + user.MatKhau + "'";
            DataTable dt = ConnectDB.ExecQuery(sql); 
            if (dt.Rows.Count != 0) 
            { return true;
            }
            else 
            {
                return false; 
            }
        }
        public static DataTable LayDanhSachNguoiDung()
        {
            string sql = "Select * from DANGNHAP";
            return ConnectDB.ExecQuery(sql); 
        }
    }
}
